<?php 
if(isset ($_GET['admin_flag']) && $_GET['admin_flag']=='ON') {
    header('Location: index_admin.php');
    die;
       
}

require_once('dao.php');

//dirt implementation start
$response = DAOFactory::getPA1DAO()->queryBySeg(1);
    if ($response):
        foreach ($response as $key => $value):
            $des1= DAOFactory::getDescriptionDAO()->load($value->dES);
            $img1 = DAOFactory::getImageDAO()->load($value->iMAGE);
        endforeach;
 endif;
 
  $response = DAOFactory::getPA1DAO()->queryBySeg(2);
    if ($response):
        foreach ($response as $key => $value):
            
            $des2 = DAOFactory::getDescriptionDAO()->load($value->dES);
            $img2 = DAOFactory::getImageDAO()->load($value->iMAGE);
        endforeach;
     endif;
     
     $response = DAOFactory::getPA1DAO()->queryBySeg(3);
    if ($response):
        foreach ($response as $key => $value):
            $des3 = DAOFactory::getDescriptionDAO()->load($value->dES);
            $img3 = DAOFactory::getImageDAO()->load($value->iMAGE);
        endforeach;
     endif;
     
     $response = DAOFactory::getPA1DAO()->queryBySeg(4);
    if ($response):
        foreach ($response as $key => $value):
            $des4 = DAOFactory::getDescriptionDAO()->load($value->dES);
            $img4 = DAOFactory::getImageDAO()->load($value->iMAGE);
        endforeach;
     endif;

     
    $response = DAOFactory::getPA1DAO()->queryBySeg(5);
    if ($response):
        foreach ($response as $key => $value):
            $des5 = DAOFactory::getDescriptionDAO()->load($value->dES);
            $img5 = DAOFactory::getImageDAO()->load($value->iMAGE);
        endforeach;
     endif;
 //dirt impl end
 

?>

<?php include_once 'include/header.php'; ?>

		
		<div class="main_container_index">
			<div class="box">
				<div class="inner_box">
			
                                    <h2><?php echo $sess->TVar($mh1->textEn,$mh1->textSv); ?></h2>
					<a href="information.php"><?php echo $sess->TVar($l11->linkEn,$l11->linkSv);  ?></a><br />
					<a href="kontakt.php"><?php echo $sess->TVar($l21->linkEn,$l21->linkSv); ?></a>
					<p> <?php echo c_to_html($sess->TVar($des1->textEn,$des1->textSv)); ?> </p>
					<img src="<?php echo IMAGE_PATH.$img1->name; ?>"/>
				</div>
				<div id="box_shadow"></div>
			</div>
			
			<div class="box">
				<div class="inner_box">
					<h2><?php echo $sess->TVar($mh2->textEn,$mh2->textSv); ?></h2>
					<a href="aktuelt.php"><?php echo $sess->TVar($l12->linkEn,$l12->linkSv);  ?></a><br />
					<a href="arkiv.php"><?php echo $sess->TVar($l22->linkEn,$l22->linkSv);  ?></a>
					<img src="<?php echo IMAGE_PATH.$img2->name; ?>"/>
                                        <p><?php echo c_to_html($sess->TVar($des2->textEn,$des2->textSv)); ?></p>
				</div>
				<div id="box_shadow"></div>
			</div>
			
			<div class="box">
				<div class="inner_box">
					<h2><?php echo $sess->TVar($mh3->textEn,$mh3->textSv); ?></h2>
					<a href="strategi.php"><?php echo $sess->TVar($l13->linkEn,$l13->linkSv);  ?></a><br />
					<a href="immate.php"><?php echo $sess->TVar($l23->linkEn,$l23->linkSv);  ?></a>
					<p><?php echo c_to_html($sess->TVar($des3->textEn,$des3->textSv)); ?></p>
					<img src="<?php echo IMAGE_PATH.$img3->name; ?>"/>
				</div>
				<div id="box_shadow"></div>
			</div>
			
			<div class="box">
				<div class="inner_box">
					<h2><?php echo $sess->TVar($mh4->textEn,$mh4->textSv); ?></h2>
					<a href="forelasningar.php"><?php echo $sess->TVar($l14->linkEn,$l14->linkSv);  ?></a><br />
					<a href="bocker.php"><?php echo $sess->TVar($l24->linkEn,$l24->linkSv);  ?></a>
					<img src="<?php echo IMAGE_PATH.$img4->name; ?>"/>
					<p><?php echo c_to_html($sess->TVar($des4->textEn,$des4->textSv)); ?></p>
				</div>
				<div id="box_shadow"></div>
			</div>
			
			<div class="box">
				<div class="inner_box">
					<h2><?php echo $sess->TVar($mh5->textEn,$mh5->textSv); ?></h2>
					<a href="forum.php"><?php echo $sess->TVar($l15->linkEn,$l15->linkSv);  ?></a><br />
					<a href="vada_design.php"><?php echo $sess->TVar($l25->linkEn,$l25->linkSv); ?></a>
					<p><?php echo c_to_html($sess->TVar($des5->textEn,$des5->textSv)); ?></p>
					<img src="<?php echo IMAGE_PATH.$img5->name; ?>"/>
				</div>
				<div id="box_shadow"></div>
			</div>
		</div>
		
<?php include_once 'include/footer.php'; ?>	